home *** CD-ROM | disk | FTP | other *** search
- ******************************************************************************
- * PROGRAM: Equipmnt.wfm
- *
- * WRITTEN BY: Borland Samples Group
- *
- * DATE: 5/93
- *
- * UPDATED: 6/94
- *
- * REVISION: $Revision: 1.49 $
- *
- * VERSION: dBASE FOR WINDOWS 5.0
- *
- * DESCRIPTION: This program allows changing equipment for the AirBorland
- * airlines -- it uses a main display form (defined here), and
- * other dialog forms (changeq.wfm, getflts.wfm) for obtaining
- * information for its display.
- *
- * PARAMETERS: None
- *
- * CALLS: Equipmnt.mnu (Menu for this form)
- * Changeq.wfm (Form for changing equipment)
- * Equipmnt.qbe (View of tables)
- *
- * USAGE: DO Equipmnt.wfm
- *
- *******************************************************************************
- create session
- set talk off
- set ldCheck off
-
-
- ** END HEADER -- do not remove this line*
- * Generated on 06/01/94
- *
- LOCAL f
- f = NEW EQUIPMNTFORM()
- f.Open()
-
- CLASS EQUIPMNTFORM OF FORM
- this.ColorNormal = "N/0XFFFF80"
- this.MousePointer = 1
- this.MDI = .F.
- this.Width = 99.52
- this.Top = 0.00
- this.Left = 2.97
- this.Text = "Flight Equipment Management"
- this.Maximize = .F.
- this.Minimize = .F.
- this.View = "EQUIPMNT.QBE"
- this.MenuFile = "EQUIPMNT.MNU"
- this.Height = 26.42
- this.HelpFile = ""
- this.HelpId = ""
- this.OnOpen = CLASS::ONOPEN
- this.OnClose = CLASS::ONCLOSE
-
- DEFINE IMAGE LOGOIMAGE OF THIS;
- PROPERTY;
- Width 99.60,;
- Top 0.00,;
- Left 0.66,;
- Alignment 2,;
- DataSource "FILE AIRBRLND.BMP",;
- Height 6.88
-
- DEFINE TEXT TITLE OF THIS;
- PROPERTY;
- ColorNormal "B/0XFFFF80",;
- Width 99.02,;
- Top 7.16,;
- Left 0.00,;
- Text "Flight Information",;
- Alignment 1,;
- Border .F.,;
- FontSize 14.00,;
- Height 2.20
-
- DEFINE BROWSE FLIGHTSBROWSE OF THIS;
- PROPERTY;
- Fields "FLIGHTS->FLIGHT_NO\H='FLIGHT NO'\12,FLIGHTS->ORIGIN\8,FLIGHTS->DEST\H='DESTINATION'\14,FLIGHTS->PRICE\12,FLIGHTS->DATE\12,FLIGHTS->DEPARTURE\12,FLIGHTS->ARRIVAL\16",;
- ColorNormal "N/W",;
- Width 93.62,;
- ShowRecNo .F.,;
- Top 8.80,;
- Alias "Flights",;
- Left 3.15,;
- FontBold .F.,;
- Modify .F.,;
- Height 7.13
-
- DEFINE PUSHBUTTON EQUIPBUTTON OF THIS;
- PROPERTY;
- ColorNormal "B/W",;
- Width 32.99,;
- Top 17.61,;
- OnClick CLASS::CHANGEEQUIPMNT ,;
- Left 63.35,;
- Text "Change Equipment",;
- FontSize 12.00,;
- Default .T.,;
- Height 3.30
-
- DEFINE ENTRYFIELD PLANEENTRY OF THIS;
- PROPERTY;
- ColorNormal "B/0XFFFF80",;
- Width 19.80,;
- Top 16.29,;
- Left 6.60,;
- Enabled .F.,;
- Border .F.,;
- FontSize 12.00,;
- DataLink "AIRCRDB->AIRCRAFT",;
- Height 1.17
-
- DEFINE IMAGE PLANEIMAGE OF THIS;
- PROPERTY;
- Width 46.19,;
- Top 17.61,;
- Left 6.60,;
- DataSource "BINARY AIRCRDB->IMAGE",;
- Height 7.37
-
- *******************************************************************************
- procedure OnOpen
- *******************************************************************************
- private fld
-
- set exact off
- set fields to
- set fields off
- shell(.f.)
-
- *** Create arrays for use in GetFlts.wfm in order to bring it up faster
-
- public originAr, destAr
- local curRecCnt
- private fld, tagName
-
- *** Make array of unique origins
- use flights in select() alias temp
- select temp
- tagName = field(2) + "UN"
- set order to &tagName && Origin unique tag
- count to curRecCnt && For declaring array
- declare originAr[curRecCnt,1]
- fld = field(2) && Origin field
- copy to array originAr field &fld
-
- *** Make array of unique destinations
- tagName = field(3) + "UN"
- set order to &tagName && Destination unique tag
- count to curRecCnt && For declaring array
- declare destAr[curRecCnt,1]
- fld = field(3) && Dest field
- copy to array destAr field &fld
- use
-
- select flights && Return to original workarea
-
-
- *******************************************************************************
- procedure OnClose
- *******************************************************************************
- release originAr, destAr
- shell(.t.)
-
-
- *******************************************************************************
- procedure ChangeEquipmnt
- *******************************************************************************
- local curAircraft, newAircraft
- curAircraft = flights->aircraft && Save current aircraft
- newAircraft = CLASS::CallChangeEqForm(curAircraft)
- if curAircraft <> newAircraft && Only change table with new aircraft
- replace flights->aircraft with newAircraft
- refresh
- endif
-
- *******************************************************************************
- function CallChangeEqForm(curAircraft)
-
- * Open modally form ChangeEq, which allows changing the plane currently used.
- * ChangeEq.wfm has a listbox of plane names, and an image of the name currently
- * highlighted in the listbox. The image is defined on a binary field of
- * Aircrdb.dbf, and the listbox is defined on its name field, so the image
- * changes as you move through the listbox.
- *******************************************************************************
- local changeEqForm, childRec, retVal
-
- childRec = recno("aircrdb") && This is for highlighting current
- set procedure to Changeq.wfm additive && plane in the Changeq form's listbox
- create session
- changEqForm = new ChangEqForm()
- changEqForm.mdi = .F.
- changEqForm.value = curAircraft
- changEqForm.childRec = childRec
- changEqForm.Readmodal()
- retVal = changEqForm.value
- changEqForm.Release()
- return retVal && Return the new airplane
-
-
- ENDCLASS
-
-
-
-
-
-
-
-
-
-
-